<template>
  <view class="member-card">
    <image :src="member.avatar" class="avatar"></image>
    <view class="info">
      <text class="name">{{ member.name }}</text>
      <text class="status">{{ member.status }}</text>
      <text class="marble-count">弹珠：{{ 
        typeof member.marbles === 'number' ? member.marbles : 
        (member.marbles ? member.marbles.length : 0) 
      }}</text>
    </view>
  </view>
</template>

<script>
export default {
  props: {
    member: {
      type: Object,
      required: true
    }
  }
}
</script>

<style>
.member-card {
  display: flex;
  align-items: center;
  padding: 16px;
  margin-bottom: 12px;
  background-color: #ffffff;
  border-radius: 12px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
}

.member-card:active {
  transform: scale(0.98);
}

.avatar {
  width: 48px;
  height: 48px;
  border-radius: 24px;
  margin-right: 16px;
  border: 2px solid #f5f5f5;
}

.info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.name {
  font-size: 18px;
  font-weight: bold;
  color: #333333;
}

.status {
  font-size: 14px;
  color: #666666;
  display: inline-block;
  padding: 2px 8px;
  border-radius: 10px;
  background-color: #f0f0f0;
}

.status[status="已准备"] {
  color: #4CAF50;
  background-color: #e8f5e9;
}

.status[status="准备中"] {
  color: #FF9800;
  background-color: #fff3e0;
}

.status[status="未准备"] {
  color: #F44336;
  background-color: #ffebee;
}

.marble-count {
  font-size: 16px;
  font-weight: 500;
  color: #2196F3;
  display: flex;
  align-items: center;
}

.marble-count::before {
  content: "•";
  color: #2196F3;
  margin-right: 6px;
  font-size: 20px;
}
</style>
